home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9950 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Standard question - pointer initialization
  5. Date: 14 Mar 1996 09:02:37 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4i9jfdINNbbv@keats.ugrad.cs.ubc.ca>
  8. References: <4hk9un$906@hammer.msfc.nasa.gov> <4hnpsl$g8c@hacgate2.hac.com> <4hq9hsINN998@keats.ugrad.cs.ubc.ca> <4i7cgn$5da@baygull.rtd.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4i7cgn$5da@baygull.rtd.com>,
  12. Ronald Collins <collins@RTD.COM> wrote:
  13.  >Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) wrote:
  14.  >
  15.  >: Also note that NULL is just a macro that stands for the value zero (often
  16.  >: accompanied by a cast to void *). In assigning default initialization values to
  17.  >: static variables, the compiler couldn't care less that there is a pre-processor
  18.  >: macro called NULL. NULL can never be anything other than zero in a
  19.  >: standard-conforming implementation of the C language.
  20.  >
  21.  >This may be true on _your_ implementation, but nothing in the standard
  22.  >requires the NULL value to be numerically 0.
  23.  >
  24.  >Please read the FAQ before posting on the subject again.
  25.  
  26. You read the standard _and_ the FAQ yourself! In what the rest of the world
  27. agrees upon as the the definition of the C language, constant integral 
  28. expressions with a value of zero are converted to a null pointer when they
  29. appear in a pointer context (such as an assignment to, or comparison with,
  30. a pointer).
  31.  
  32. Other integral mappings from integral expressions to pointers are
  33. implementation defined with the intention that the mapping is not
  34. surprising to someone who knows the local system architecture, to paraphrase
  35. the standard loosely.
  36.  
  37. As a newcomer to comp.lang.c, you have fallen into the trap of assuming
  38. that since you are competent in C programming, the contents of the FAQ
  39. is just a bunch of stuff that agrees with what you already know, and
  40. thus you are exempt from actually reading it, though as an obvious
  41. expert you may refer others to the document.
  42. -- 
  43.  
  44.